MenuHost

interface MenuHost(source)

A class that allows you to host and keep track of MenuProviders that will supply android.view.MenuItems to the app bar.

See also

Functions

Link copied to clipboard
abstract fun addMenuProvider(@NonNull provider: @NonNull MenuProvider)
abstract fun addMenuProvider(@NonNull provider: @NonNull MenuProvider, @NonNull owner: @NonNull LifecycleOwner)
Adds the given MenuProvider to this MenuHost.
abstract fun addMenuProvider(@NonNull provider: @NonNull MenuProvider, @NonNull owner: @NonNull LifecycleOwner, state: @NonNull Lifecycle.State)
Adds the given MenuProvider to this MenuHost once the given LifecycleOwner reaches the given Lifecycle.State.
Link copied to clipboard
abstract fun invalidateMenu()
Invalidates the android.view.Menu to ensure that what is displayed matches the current internal state of the menu.
Link copied to clipboard
abstract fun removeMenuProvider(@NonNull provider: @NonNull MenuProvider)
Removes the given MenuProvider from this MenuHost.